package a.f.h.c;

import a.c.e;
import a.c.m;
import a.c.q;
import a.c.w;
import a.i.n;

public class f
  implements g
{
  public static boolean a;
  
  public void a(a.f.h.b.f paramf, l paraml1, l paraml2)
  {
    n.a(this, 3, "SSP Compaction");
    n.a(this, 3, "Vertical: ");
    a(paraml1);
    n.a(this, 3, "Horizontal: ");
    a(paraml2);
  }
  
  public void a(l paraml)
  {
    boolean bool = d.o;
    int j = d.n;
    q localq = paraml.m();
    a.c.x localx = localq.B();
    int[] arrayOfInt = new int[localq.j()];
    a.a.x.a(localq, arrayOfInt);
    e[] arrayOfe = new e[localq.k()];
    w localw = localq.v();
    e locale;
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        locale = localw.d();
        localx.a(locale, 0.0D);
        arrayOfe[arrayOfInt[locale.f()]] = locale;
        localw.f();
      } while (j == 0);
    } while (bool);
    int i = 0;
    label286:
    label371:
    do
    {
      double d1;
      do
      {
        if (i >= arrayOfe.length) {
          break label384;
        }
        locale = arrayOfe[i];
        d1 = localx.getDouble(locale);
        paraml.b(locale).a((int)d1);
        if ((!bool) && (j != 0)) {
          return;
        }
        if (d1 > 100000.0D) {
          throw new RuntimeException("Compaction did not terminate ...");
        }
        d locald = paraml.b(locale);
        k localk = paraml.a(locald);
        if (((!bool) && (localk == null)) || ((!bool) && (localk.b() != locald))) {
          break;
        }
        if (bool) {
          break label286;
        }
        localObject = localk.a().b();
        if (localx.getDouble(localObject) >= d1 - localk.c()) {
          break;
        }
        localx.a(localObject, d1 - localk.c());
        i = arrayOfInt[localObject.f()];
      } while (j == 0);
      Object localObject = locale.n();
      do
      {
        do
        {
          if (!((m)localObject).e()) {
            break label371;
          }
          a.c.d locald1 = ((m)localObject).a();
          double d2 = paraml.c(locald1);
          if (j != 0) {
            break;
          }
          if (d1 + d2 > localx.getDouble(locald1.f())) {
            localx.a(locald1.f(), d1 + d2);
          }
          ((m)localObject).f();
        } while (j == 0);
        i++;
      } while (bool);
    } while (j == 0);
    label384:
    if (!bool) {
      localq.a(localx);
    }
  }
  
  public void a(l paraml, a.c.x paramx, e parame, double paramDouble)
  {
    paramx.a(parame, paramDouble);
    if (paramDouble > 100000.0D) {
      throw new RuntimeException("Compaction did not terminate ...");
    }
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.f.h.c.f
 * JD-Core Version:    0.7.0.1
 */